import ArrayQueue from "../02_队列结构/01_实现队列结构";

class ArrayDeque<T> extends ArrayQueue<T> {
  addFront(value: T): void {
    this._data.unshift(value);
  }
  removeBack(): T | undefined {
    return this._data.pop();
  }
}

const deque = new ArrayDeque<string>();
deque.enqueue("a");
deque.enqueue("b");
deque.enqueue("c");
deque.addFront("d");
deque.addFront("e");

while (!deque.isEmpty()) {
  console.log(deque.removeBack());
}

export {};
